package org.kukker.dialog;

import java.util.Properties;

import org.kukker.R;
import org.kukker.view.SearchEventsInput;

import android.app.Dialog;
import android.content.Context;

import android.view.View;

import android.widget.Button;

public class SearchDialog extends Dialog{
	private Button searchButton;
	private Context mContext;
	private View.OnClickListener mSearchOnClickListener;
	private Properties searchParams;
	
	public SearchDialog(Context context) {
		super(context);
		this.mContext = context;
		this.setContentView(R.layout.dialog_searchevent);
		this.setTitle("Search public events");
		searchButton = (Button) this.findViewById(R.id.eventsearchinput_button_search);
		searchButton.setOnClickListener(new View.OnClickListener(){
			public void onClick(View arg0) {
				SearchEventsInput esi = (SearchEventsInput) findViewById(R.id.eventsearchinput_searcheventsinput);
				searchParams = esi.getSearchParameters();				
				mSearchOnClickListener.onClick(null);
				dismiss();
			}
		});
	}

	public Properties getSearchParams(){
		return this.searchParams;
	}
	
	public void setOnSearchClickListener(View.OnClickListener listener){
		this.mSearchOnClickListener = listener;
	}
	
}